#ifndef _modbus_h
#define _modbus_h

#include "headfile.h"

// 主机状态
#define SEND 10
#define RECEIVE 20
#define ERROR 30
// 查询长度
#define device_len 8
// 功能码
#define GET_SPEED 0x04
// 寄存器地址
#define ADDR_HIGH 0x10
#define ADDR_LOW 0x10
#define ADDR_TOTAL_HIGH 0x10
#define ADDR_TOTAL_LOW 0x18
#define LENGTH_HIGH 0x00
#define LENGTH_LOW 0x02
// 解析数据
#define RUN 30
#define STOP 40

void ask_for_data();

void analysis();

void ask_for_unit();

#endif